package org.canto.poss.instr.common.pojo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * Entity基类
 *
 * @author jsryin
 * @version 2021-07-07
 */
public class BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 未删除
     */
    public static final String DEL_FLAG_NOT = "1";

    /**
     * 已删除
     */
    public static final String DEL_FLAG_YES = "0";

    /**
     * 唯一标识ID
     */
    protected String id;

    /**
     * 标记 0：删除，1：正常
     */
    protected String flag;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    protected Date createTime;

    /**
     * 最后修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    protected Date updateTime;


    public BaseEntity() {
    }

    public String getId() {
        return id;
    }

    public BaseEntity setId(String id) {
        this.id = id;
        return this;
    }

    public String getFlag() {
        return flag;
    }

    public BaseEntity setFlag(String flag) {
        this.flag = flag;
        return this;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public BaseEntity setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public BaseEntity setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return this;
    }
}
